using System;
using System.ComponentModel.DataAnnotations;

namespace Work.Domain
{
    /// <summary>
    /// 支付记录
    /// </summary>
    public class Payment
    {
        /// <summary>
        /// 支付ID
        /// </summary>
        [Key]
        public int PaymentId { get; set; }

        /// <summary>
        /// 预约编号（外键）
        /// </summary>
        public int AppointmentId { get; set; }

        /// <summary>
        /// 就诊人编号（外键，冗余字段）
        /// </summary>
        public int PatientId { get; set; }

        /// <summary>
        /// 挂单号（冗余字段）
        /// </summary>
        public string? RegistrationNum { get; set; }

        /// <summary>
        /// 总金额（挂号费+其他费+药品费）
        /// </summary>
        public decimal TotalAmount { get; set; }

        /// <summary>
        /// 支付金额
        /// </summary>
        public decimal PaidAmount { get; set; }

        /// <summary>
        /// 找零
        /// </summary>
        public decimal Change { get; set; }

        /// <summary>
        /// 支付状态（未支付/已支付）
        /// </summary>
        public string? PaymentStatus { get; set; }

        /// <summary>
        /// 支付时间
        /// </summary>
        public DateTime? PaymentTime { get; set; }

        /// <summary>
        /// 支付方式（现金/支付宝/微信等，可选）
        /// </summary>
        public string? PaymentMethod { get; set; }

        /// <summary>
        /// 是否打印发票
        /// </summary>
        public bool InvoicePrinted { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        // 导航属性
        /// <summary>
        /// 关联的预约信息
        /// </summary>
        public virtual Appintment? Appointment { get; set; }

        /// <summary>
        /// 关联的患者信息
        /// </summary>
        public virtual Patient? Patient { get; set; }
    }
}

